package com.fjnldx.ks.controller;

import com.fjnldx.ks.pojo.request.Gx;
import com.fjnldx.ks.pojo.request.ScjhReq2;
import com.fjnldx.ks.pojo.request.ScjhReq3;
import com.fjnldx.ks.pojo.response.Result;
import com.fjnldx.ks.service.MesForthService;
import com.fjnldx.ks.service.MesScjhService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


/**
 * @author 11759
 */
@RestController
@RequestMapping("/api-scjh")
@Api(value = "生产计划模块", tags = "生产计划模块")
public class MesScjhController {
    @Resource
    MesForthService mesForthService;
    @Resource
    MesScjhService mesScjhService;

    @PostMapping("/importExcelToDataBaseScjhXiSha")
    @ApiOperation(value = "导入生产计划Excel（细纱）", notes = "格式（.xls标准文件）")
    public Result mesSc10(@RequestParam("file") MultipartFile file) {
        Result result = mesForthService.uploadExcelFileScjhXisha(file);
        return result;
    }

    @PostMapping("/importExcelToDataBaseScjhCuSha")
    @ApiOperation(value = "导入生产计划Excel（粗纱）", notes = "格式（.xls标准文件）")
    public Result mesSc11(@RequestParam("file") MultipartFile file) {
        Result result = mesForthService.uploadExcelFileScjhChusha(file);
        return result;
    }

    @PostMapping("/importExcelToDataBaseScjhLuoTong")
    @ApiOperation(value = "导入生产计划Excel（络筒）", notes = "格式（.xls标准文件）")
    public Result mesSc12(@RequestParam("file") MultipartFile file) {
        Result result = mesForthService.uploadExcelFileScjhLuoTong(file);
        return result;
    }
    @PostMapping("/getMesScjhLlZc")
    @ApiOperation(value = "查询当天各工序理论总产量/天", notes = "查询各工序理论总产量/天")
    public Result mesSc13() {
        Result mesScjhByTime = mesScjhService.getMesScjhByTime();
        return mesScjhByTime;
    }
    @PostMapping("/getMesScjhLlPzZc")
    @ApiOperation(value = "查询当天各工序各品种理论总产量/天", notes = "查询当天各工序各品种理论总产量/天")
    public Result mesSc16(@RequestBody Gx gx) {
        Result mesScjhLlPzZc = mesScjhService.getMesScjhLlPzZc(gx);
        return mesScjhLlPzZc;
    }
    @PostMapping("/getMesScjhSjPzZc")
    @ApiOperation(value = "查询当天各工序各品种实际总产量/天", notes = "查询当天各工序各品种实际总产量/天")
    public Result mesSc17(@RequestBody Gx gx) {
        Result mesScjhSjPzZc = mesScjhService.getMesScjhSjPzZc(gx);
        return mesScjhSjPzZc;
    }
    @PostMapping("/getMesScjhLlTc")
    @ApiOperation(value = "查询当天各工序各设备的理论台产/天", notes = "查询各工序各设备的理论台产/天")
    public Result mesSc14(@RequestBody ScjhReq2 scjhReq2) {
        Result mesScjhTcByDevSn = mesScjhService.getMesScjhTcByDevSn(scjhReq2);
        return mesScjhTcByDevSn;
    }
    @PostMapping("/getMesScjhSjZc")
    @ApiOperation(value = "查询各工序实际总产量/天", notes = "查询各工序实际总产量/天")
    public Result mesSc15() {
        Result mesScjhSjZc = mesScjhService.getMesScjhSjZc();
        return mesScjhSjZc;
    }
    @PostMapping("/getMesScjhSjTc")
    @ApiOperation(value = "查询各工序各设备实际台产量/天", notes = "查询各工序各设备实际台产量/天")
    public Result mesSc16(@RequestBody ScjhReq3 scjhReq3) {
        Result mesScjhSjTc = mesScjhService.getMesScjhSjTc(scjhReq3);
        return mesScjhSjTc;
    }
}